import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '@/views/home'),
    children: [{
      path: '/home/index',
      name: 'Index',
      component: () => import(/* webpackChunkName: "index" */ '@/views/home/index/index.vue')
    },{
      path: '/home/car',
      name: 'Car',
      component: () => import(/* webpackChunkName: "car" */ '@/views/home/car/index.vue')
    },{
      path: '/home/my',
      name: 'My',
      component: () => import(/* webpackChunkName: "my" */ '@/views/home/my/index.vue')
    },]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '@/views/login')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
